<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'logManager.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<script type="text/javascript"
	src="/OA/system/dateCalendar/WdatePicker.js"></script>
<link rel="stylesheet" type="text/css" href="/OAProject/admin_cg/system/css/operateLogManager.css">
</head>

<body>
	<!--备注：
		1. 可以删除选中的日志
		2. 日志从数据库中获取   -->
	<div id="all">
		<div id="header">>>当前位置：操作日志管理</div>
		<div id="content">
				<form action="/OAProject/bt/operatelog_delete" enctype="multipart/form-data">
					<div id="div-quanxuan">
						<input type="checkbox" id="checkAll" name="checkAll"
							onchange="quanxuan();" />全选
					</div>
					<div id="div-delete">
						<input type="submit" value="删除选定项" />
					</div>
					<table id="all-table" border="1" cellspacing="0" cellpadding="5" >
						<tr>
							<th>选定 (√)</th>
							<th>序号</th>
							<th>操作用户</th>
							<th>事件</th>
							<th>操作描述</th>
							<th>操作时间</th>
						</tr>
						<s:iterator value="%{#session.operateloglist}" >
						<tr>
							<td><input type="checkbox" name="logvalue"
									onclick="xuan();" value=<s:property value="%{operateid}"/> /></td>
							<td><s:property value="%{operateid}" /></td>
							<td><s:property value="%{userinfo.username}" /></td>
							<td><s:property value="%{operatenname}" /></td>
							<td><s:property value="%{operatedesc}" /></td>
							<td><s:property value="%{operatetime}" /></td>
						</tr>
						</s:iterator>
					</table>
					
				</form>
				<p id="form-p">	总共<s:property value="pageBean.totalPage" />页，当前【<s:property value="pageBean.currentPage" />/<s:property value="pageBean.totalPage" />】页，
							<s:a href="/OAProject/bt/operatelog_getAll?currentPage=%{1}" >首页</s:a>
							<s:a href="/OAProject/bt/operatelog_getAll?currentPage=%{pageBean.currentPage-1}" >上一页</s:a>
							<s:a href="/OAProject/bt/operatelog_getAll?currentPage=%{pageBean.currentPage+1}"  >下一页</s:a>
							<s:a href="/OAProject/bt/operatelog_getAll?currentPage=%{pageBean.totalPage}" >末页</s:a></p>
			</div>
	</div>
	
	<script type="text/javascript">
		//全选  和  取消 全选
		function quanxuan() {
			var checkAll = document.getElementById("checkAll");
			var logvalue = document.getElementsByName("logvalue");
			if (checkAll.checked == true) {
				for (var i = 0; i < logvalue.length; i++) {
					logvalue[i].checked = true;
				}
			} else {
				for (var i = 0; i < logvalue.length; i++) {
					logvalue[i].checked = false;
				}
			}
		}
		function xuan() {
			var checkAll = document.getElementById("checkAll");
			var logvalue = document.getElementsByName("logvalue");
			var flag = false;
			for (var i = 0; i < logvalue.length; i++) {
				if (logvalue[i].checked == false) {
					checkAll.checked = false;
					flag = true;
				}
				if (!flag) {
					checkAll.checked = true;
				}
			}
		}
	</script>
	<%-- <!--备注：
			
		1. 可以删除选中的日志
		2. 日志从数据库中获取   -->
	<div id="all">
		<div id="header">1</div>
		<div id="content">
			<div id="content-left">
				<form action="DoLog" method="post">
					<input type="hidden" name="type" value="delete" />
					<p>当前位置：登录日志</p>

					输入时间段：<br /> <input id="date" name="startTime"
						onclick="WdatePicker({el:this,dateFmt:'yyyy-MM-dd HH:mm:00',onpicked:null})" /><br />
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--- <br />
					<input id="date" name="endTime"
						onclick="WdatePicker({el:this,dateFmt:'yyyy-MM-dd HH:mm:00',onpicked:null})" /><br />
					<br /> <input type="radio" name="radioTime" />本日 <input
						type="radio" name="radioTime" />本周 <input type="radio"
						name="radioTime" />本月<br />
					<br /> <a href="DoLog?type=getAll"><button>查询</button></a>

				</form>
			</div>
			<div id="content-right">
				<div id="div-quanxuan">
					<input type="checkbox" id="checkAll" name="checkAll"
						onchange="quanxuan();" />全选
				</div>
				<div id="div-delete">
					<input type="submit" value="删除选定项" />
				</div>
				<table id="all-table" border="1" cellspacing="0" cellpadding="5">
					<tr>
						<th>选定(√)</th>
						<th>序号</th>
						<th>操作用户</th>
						<th>事件</th>
						<th>描述</th>
						<th>时间</th>
						<th>操作</th>
					</tr>
					<s:iterator value="%{#session.operateloglist}">
						<tr>
							<td><input type="checkbox" name="operatelogvalue" value='<s:property value="%{operateid}" />' /> </td>
							<td><s:property value="%{operateid}" /></td>
							<td><s:property value="%{userinfo.username}" /></td>
							<td><s:property value="%{operatename}" /></td>
							<td><s:property value="%{operatedesc}" /></td>
							<td><s:property value="%{operatetime}" /></td>
							<td><s:a href="operatelog_one?operatelog.operateid=%{operateid}">修改</s:a>&nbsp;&nbsp; 
								<s:a href="operatelog_delete?operatelog.operateid=%{operateid}">删除</s:a></td>
						</tr>
					</s:iterator>
				</table>
			</div>
		</div>
	</div>


	<script type="text/javascript">
		//全选  和  取消 全选
		function quanxuan() {
			var checkAll = document.getElementById("checkAll");
			var logvalue = document.getElementsByName("logvalue");
			if (checkAll.checked == true) {
				for (var i = 0; i < logvalue.length; i++) {
					logvalue[i].checked = true;
				}
			} else {
				for (var i = 0; i < logvalue.length; i++) {
					logvalue[i].checked = false;
				}
			}
		}
		function xuan() {
			var checkAll = document.getElementById("checkAll");
			var logvalue = document.getElementsByName("logvalue");
			var flag = false;
			for (var i = 0; i < logvalue.length; i++) {
				if (logvalue[i].checked == false) {
					checkAll.checked = false;
					flag = true;
				}
				if (!flag) {
					checkAll.checked = true;
				}
			}
		}
	</script> --%>
</body>
</html>
